package com.news.user.controller.v1;

import com.news.model.common.dtos.ResponseResult;
import com.news.model.user.dtos.ApUserRealnameDto;
import com.news.user.service.ApUserRealnameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户审核类
 */
@RestController
@RequestMapping("/api/v1/auth")
@Slf4j
public class ApUserRealnameController {

    @Autowired
    private ApUserRealnameService apUserRealnameService;

    /**
     * 分页查询注册列表
     * @param apUserRealnameDto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody ApUserRealnameDto apUserRealnameDto){
        return apUserRealnameService.pageList(apUserRealnameDto);
    }

    /**
     * 审核通过
     * @param apUserRealnameDto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody ApUserRealnameDto apUserRealnameDto){
        return apUserRealnameService.authPass(apUserRealnameDto);
    }

    /**
     * 审核失败
     * @param apUserRealnameDto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody ApUserRealnameDto apUserRealnameDto){
        return apUserRealnameService.authFail(apUserRealnameDto);
    }
}
